package b3.widget.home.town
{
	import b3.config.*;
	import b3.model.*;
	import b3.net.*;
	import b3.util.*;
	import b3.widget.*;
	import b3.widget.basic.*;
	
	import com.greensock.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.filters.*;
	import flash.text.*;

	public class DarkCoinPane extends BasicWidget
	{
		private var darkCoinText:TextField;
		
		public function DarkCoinPane()
		{
			super();
			var GoldIngotPaneBgr:Class = ResourceHelper.getInstance().getClassByName("DarkCoinPaneBgr");
			addChild(new GoldIngotPaneBgr());
			darkCoinText = new TextField();
			darkCoinText.selectable = false;
        	darkCoinText.autoSize = TextFieldAutoSize.CENTER;
			darkCoinText.defaultTextFormat = new TextFormat(BFont.fontName, 13, 0x000000);
//			darkCoinText.filters = [new GlowFilter(0xFFFF00, 1, 1.3, 1.3, 100, BitmapFilterQuality.HIGH)];
			darkCoinText.x = 50;
			darkCoinText.y = -2;
			addChild(darkCoinText);
			PlayerManager.getInstance().me.packageModel.addEventListener(ModelEvent.REFRESH, onRefresh);
			onRefresh(null);
		}
		
		private function onRefresh(event:Event):void
		{
			var darkCoin:int = PlayerManager.getInstance().me.packageModel.getObjectNum(ObjConfig.DARKCOIN);
			darkCoinText.text = " " + BFont.formatNumWithComa(darkCoin) + " ";
		}
	}
}